/**
 *	流程模块接口
 *	开发者：雨中磐石
 *	地址：www.rockoa.com
 *	日期：2023-07-29
 */

package com.framework.Module.system.company;



import com.framerock.baselib.CDate;
import com.framerock.baselib.Rock;
import com.framework.ACore.Model;
import com.framework.Flow.FlowListener;

import java.util.Map;


public class FlowListenercompany extends FlowListener {


    @Override
    public void onSaveafter(Map<String, String> da, String mid, Boolean isadd) {
        if(isadd) {
            int deptid = Model.get(this.nDb, "dept").insert(Rock.getMap(new String[]{
                    "cid", mid,
                    "name", da.get("name")
            }));
            Model.get(this.nDb,"usera").insertbo(Rock.getMap(new String[]{
                    "cid",mid,
                    "deptid",deptid+"",
                    "deptname",da.get("name"),
                    "name",mRequest.getLoginrs("name"),
                    "user",mRequest.getLoginrs("user"),
                    "mobile",mRequest.getLoginrs("mobile"),
                    "ranking","创建者",
                    "state","1",
                    "uid",mRequest.USERID,
                    "type","2",
                    "adddt", CDate.now(),
                    "workdt", CDate.date(),
            }));
        }
    }
}
